﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using FanaticRock.Core.Interfaces;
using FanaticRock.Core.Models;

namespace FanaticRock.ViewModels
{
    [INotifyPropertyChanged]
    public partial class SongMemberViewModel : IFromModel<SongMember>
    {
        #region props

        [ObservableProperty]
        private string _id;

        [ObservableProperty]
        private string _name;

        #endregion

        #region ctors

        public SongMemberViewModel()
        {
            
        }

        public SongMemberViewModel(SongMemberViewModel viewModel)
        {
            _id = viewModel._id;
            _name = viewModel._name;
        }

        public SongMemberViewModel(SongMember model)
        {
            Load(model);
        }

        #endregion

        #region from model

        public void Load(SongMember model)
        {
            _id = model.Id;
            _name = model.Name;
        }

        public SongMember Export()
        {
            return new SongMember()
            {
                Id = _id,
                Name = _name
            };
        }

        #endregion



    }
}
